package api

import (
	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/handler/api/home"
	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/logic"
	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/svc"
)

func initHandler(svc *svc.ServiceContext) []Handler {
	// new logics
	var (
		userLogic    = logic.NewUser(svc)
		commonLogic  = logic.NewCommon(svc)
		gstLogic     = logic.NewGst(svc)
		promptsLogic = logic.NewPrompts(svc)
	)

	// new handlers
	var (
		prompts = home.NewPrompts(svc, promptsLogic)
		user    = NewUser(svc, userLogic)
		common  = home.NewCommon(svc, commonLogic)
		gst     = home.NewGst(svc, gstLogic)
		ai      = home.NewAi(svc)
	)

	return []Handler{
		prompts,
		user,
		common,
		gst,
		ai,
	}
}
